home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / prog_bas / mdbguru.zip / TRUEVS.FRT < prev    next >
Text File  |  1995-02-25  |  8KB  |  266 lines

  1. VERSION 2.00
  2. Begin Form <<formname>>
  3.    Caption         =   "<<caption>>"
  4.    ClientHeight    =   6255
  5.    ClientLeft      =   1185
  6.    ClientTop       =   1575
  7.    ClientWidth     =   9420
  8.    Height          =   6660
  9.    Left            =   1125
  10.    MDIChild        =   -1  'True
  11.    ScaleHeight     =   6255
  12.    ScaleWidth      =   9420
  13.    Tag             =   "<<formname>>"
  14.    Top             =   1230
  15.    Width           =   9540
  16.    Begin Data dtaCtr 
  17.       Caption         =   "<<formname>>"
  18.       Connect         =   "<<connectstring>>"
  19.       DatabaseName    =   "<<database>>"
  20.       Exclusive       =   0   'False
  21.       Height          =   270
  22.       Left            =   5280
  23.       Options         =   0
  24.       ReadOnly        =   0   'False
  25.       RecordSource    =   "<<recordsource>>"
  26.       Top             =   60
  27.       Visible         =   0   'False
  28.       Width           =   3000
  29.    End
  30.    Begin VideoSoftElastic VSElastic1 
  31.       Align           =   5  'Fill Container
  32.       AutoSizeChildren=   1  'Even Horizontal
  33.       BevelInner      =   0  'None
  34.       BevelOuter      =   0  'None
  35.       Height          =   6255
  36.       IntBkg          =   &H00C0C0C0&
  37.       Left            =   0
  38.       TabIndex        =   21
  39.       Top             =   0
  40.       Width           =   9420
  41.       Begin VideoSoftIndexTab tab<<formname>>
  42.          BackSheets      =   0  'None
  43.          Caption         =   "Browse|Details"
  44.          FontBold        =   0   'False
  45.          FontItalic      =   0   'False
  46.          FontName        =   "MS Sans Serif"
  47.          FontSize        =   8.25
  48.          FontStrikethru  =   0   'False
  49.          FontUnderline   =   0   'False
  50.          FrontTabColor   =   &H00C0C0C0&
  51.          Height          =   6075
  52.          Left            =   90
  53.          New3D           =   -1  'True
  54.          Position        =   0  'Top
  55.          Style           =   7  'Straight 3D
  56.          TabIndex        =   22
  57.          Top             =   90
  58.          Width           =   9240
  59.          Begin VideoSoftElastic VSElastic4 
  60.             AutoSizeChildren=   1  'Even Horizontal
  61.             BevelOuter      =   0  'None
  62.             Height          =   5730
  63.             IntBkg          =   &H00C0C0C0&
  64.             Left            =   12330
  65.             TabIndex        =   0
  66.             Top             =   315
  67.             Width           =   9180
  68.          End
  69.          Begin VideoSoftElastic VSElastic3 
  70.             AccessKey       =   -1  'True
  71.             BevelOuter      =   0  'None
  72.             CaptionPos      =   6  'Right Top
  73.             CaptionStyle    =   4  'Inset Light
  74.             FontBold        =   0   'False
  75.             FontItalic      =   0   'False
  76.             FontName        =   "MS Sans Serif"
  77.             FontSize        =   8.25
  78.             FontStrikethru  =   0   'False
  79.             FontUnderline   =   0   'False
  80.             Height          =   5730
  81.             IntBkg          =   &H00C0C0C0&
  82.             Left            =   12255
  83.             TabIndex        =   24
  84.             TagWidth        =   1500
  85.             Top             =   315
  86.             Width           =   9180
  87.             <<fieldcontrols>>
  88.          End
  89.          Begin VideoSoftElastic VSElastic2 
  90.             AutoSizeChildren=   1  'Even Horizontal
  91.             BevelOuter      =   0  'None
  92.             Height          =   5730
  93.             IntBkg          =   &H00C0C0C0&
  94.             Left            =   30
  95.             TabIndex        =   23
  96.             Top             =   315
  97.             Width           =   9180
  98.             Begin TrueGrid tbl<<formname>>
  99.                AllowArrows     =   -1  'True
  100.                AllowTabs       =   -1  'True
  101.                BackColor       =   &H0080FFFF&
  102.                DataSource      =   "dtaCtr"
  103.                Editable        =   -1  'True
  104.                EditDropDown    =   -1  'True
  105.                ExposeCellMode  =   0  'Expose upon selection
  106.                FetchMode       =   0  'By cell
  107.                FontBold        =   0   'False
  108.                FontItalic      =   0   'False
  109.                FontName        =   "MS Sans Serif"
  110.                FontSize        =   8.25
  111.                FontStrikethru  =   0   'False
  112.                FontUnderline   =   0   'False
  113.                HeadingHeight   =   1
  114.                Height          =   5550
  115.                HorzLines       =   2  '3D
  116.                LayoutIndex     =   1
  117.                Left            =   90
  118.                LinesPerRow     =   1
  119.                MarqueeUnique   =   -1  'True
  120.                SplitPropsGlobal=   -1  'True
  121.                SplitTabMode    =   0  'Don't tab across splits
  122.                TabCapture      =   0   'False
  123.                TabIndex        =   19
  124.                Top             =   90
  125.                UseBookmarks    =   -1  'True
  126.                Width           =   9000
  127.                WrapCellPointer =   0   'False
  128.             End
  129.          End
  130.       End
  131.    End
  132.    Begin Label lblMsg 
  133.       Caption         =   "Label1"
  134.       Height          =   255
  135.       Left            =   3300
  136.       TabIndex        =   20
  137.       Top             =   60
  138.       Width           =   1875
  139.    End
  140. End
  141. Option Explicit
  142.  
  143. Dim lSave As Integer
  144.  
  145. Sub Form_Activate ()
  146.     activateToolBar Tag
  147.     setSave lSave
  148. End Sub
  149.  
  150. Sub Form_Load ()
  151.     Dim cLay As String
  152.     lSave = False
  153.     activateToolBar Tag
  154.     setSave lSave
  155.     
  156.     cLay = loadGridSetup(Me.Tag)
  157.     If cLay <> "" Then tbl<<formname>>.Layout = cLay
  158.     dtaCtr.DatabaseName = gcMainPath + APPLICATION_DB
  159.     dtaCtr.Refresh
  160.  
  161. End Sub
  162.  
  163. Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
  164.     If lSave Then
  165.         If Not yesno("Changes will be lost.  Close anyway?", "Close") Then
  166.             Exit Sub
  167.         Else
  168.             Cancel = True
  169.         End If
  170.     End If
  171. End Sub
  172.  
  173. Sub Form_Unload (Cancel As Integer)
  174.     deactivateToolBar
  175.     saveGridSetup (Me.Tag), (tbl<<formname>>.Layout)
  176. End Sub
  177.  
  178.  
  179.  
  180. Sub lblMsg_Change ()
  181.     On Error GoTo cantMove
  182.     Select Case lblMsg.Caption
  183.         Case ""
  184.             ' do nothing
  185.             Exit Sub
  186.  
  187.         Case MSG_ADD
  188.             lSave = True
  189.             setSave True
  190.             dtaCtr.Recordset.AddNew
  191.             tab<<formname>>.CurrTab = 1
  192.  
  193.         Case MSG_EDIT
  194.             lSave = True
  195.             setSave True
  196.             
  197.             dtaCtr.Recordset.Edit
  198.             tab<<formname>>.CurrTab = 1
  199.  
  200.         Case MSG_DELETE
  201.             ' todo:  needs integrity check
  202.             If yesno("Are you sure you want to delete the current record?", "Delete") Then
  203.                 dtaCtr.Recordset.Delete
  204.             End If
  205.             
  206.         Case MSG_CANCEL
  207.             lSave = False
  208.             setSave False
  209.             dtaCtr.Recordset.Edit
  210.             dtaCtr.Recordset.Update
  211.  
  212.         Case MSG_SAVE
  213.             lSave = False
  214.             setSave False
  215.             dtaCtr.Recordset.Update
  216.             dtaCtr.Recordset.Bookmark = dtaCtr.Recordset.LastModified
  217.  
  218.         Case MSG_REFRESH
  219.             dtaCtr.Refresh
  220.     
  221.         Case MSG_PRINT
  222.             
  223.         
  224.         Case MSG_CLOSE
  225.             lblMsg.Caption = "" ' must do this first or doing it later will reload the form
  226.             Unload Me
  227.             Exit Sub
  228.  
  229.         Case MSG_MOV_FIRST
  230.             dtaCtr.Recordset.MoveFirst
  231.  
  232.         Case MSG_MOV_PREV
  233.             dtaCtr.Recordset.MovePrevious
  234.             If dtaCtr.Recordset.BOF Then
  235.                 dtaCtr.Recordset.MoveFirst
  236.                 Beep
  237.             End If
  238.                            
  239.         Case MSG_MOV_NEXT
  240.             dtaCtr.Recordset.MoveNext
  241.             If dtaCtr.Recordset.EOF Then
  242.                 dtaCtr.Recordset.MoveLast
  243.                 Beep
  244.             End If
  245.  
  246.         Case MSG_MOV_LAST
  247.             dtaCtr.Recordset.MoveLast
  248.  
  249.     End Select
  250.  
  251.     lblMsg.Caption = ""
  252.  
  253.     'bOk(0).Enabled = False
  254.     Exit Sub
  255.  
  256. cantMove:
  257.     ErrorMsg "Unable to move records: " & Error$
  258.     Exit Sub
  259.  
  260. End Sub
  261.  
  262. Sub tab<<formname>>_Switch (OldTab As Integer, NewTab As Integer, Cancel As Integer)
  263.     If lSave And NewTab = 0 Then Cancel = True
  264. End Sub
  265.  
  266.